<div class="alert-box secondary">Students Listed On Schedules</div>
<div class="section-container auto" data-section data-options="deep_linking: true">
	<section class="active">
		<p class="title" data-section-title><a href="#advisory-students">All Advisory Students</a></p>
		<div class="content" data-slug="advisory-students" data-section-content>
			<?if($all_studs):?>
				<span class="clearfix">
				<div class="alert-box secondary">Advisory Students</div>
				<?if($all_studs['advisory']):?>
					
					<span style="font-size:11px;border:1px solid #000;padding:5px;">Toggle Edit on/off <input type="checkbox" id="grades"></span>
						<div  class="accordions">
						<?foreach ($all_studs['advisory'] as $key => $value):?>
							<h3><?=$value['Section'];?></h3>
							<div style="margin:0;padding:0">
							<table class="table table-stripped table-compressed">
									<?if($value['students']):?>
										<?foreach ($value['students'] as $sk => $sv):?>
											<tr>
												<td><?=ucwords(strtolower($sv->fullname));?></td>
												<td><?=$sv->gender;?></td>
												<td><?=$sv->age;?></td>
												<td>
													<div class="btn-group">
														<a href="<?=site_url('profile/student/'.$sv->eid);?>" class=" btn btn-mini" target="_blank"><i class="icon-user"></i> Profile</a>
														<button class="btn btn-mini btn-primary commend-student" data-url-id="<?=__link($sv->eid);?>" data-reveal-id="commendations"><i class="icon-comment"></i> Commend Student</button>
													</div>
												</td>
											</tr>
										<?endforeach;?>
									<?endif;?>
							</table>
						</div>
						<?endforeach;?>
						</div>
					
				<?else:?>
				<div class="alert-box success"><i>No Advisory Sections Assigned.</i></div>
				<?endif;?>
			<?endif;?>
		</div>
	</section>
	<section>
		<p class="title" data-section-title><a href="#subjectsched-students">All Students in Subject Schedule</a></p>
		<div class="content" data-slug="subjectsched-students" data-section-content>
			<span class="clearfix">
			<div class="alert-box secondary">Subject Schedule Students</div>
			<?if($all_studs):?>
				<?if($all_studs['schedules']):?>
					<table class="table">
						<?foreach ($all_studs['schedules'] as $key => $value):?>
							<tr class="info">
								<td colspan="4"><strong><?=$value['Section'];?></strong></td>
							</tr>
							<?if($value['students']):?>
								<?foreach ($value['students'] as $sk => $sv):?>
									<tr>
										<td><?=ucwords(strtolower($sv->fullname));?></td>
										<td><?=$sv->gender;?></td>
										<td><?=$sv->age;?></td>
										<td>
											<div class="btn-group">
												<a href="<?=site_url('profile/student/'.$sv->eid);?>" class=" btn btn-mini" target="_blank"><i class="icon-user"></i> Profile</a>
												<button class="btn btn-mini btn-primary commend-student" data-url-id="<?=__link($sv->eid);?>" data-reveal-id="commendations"><i class="icon-comment"></i> Commend Student</button>
											</div>
										</td>
									</tr>
								<?endforeach;?>
							<?else:?>
								<tr class="important">
									<td colspan="3"><i>No Students</i></td>
								</tr>
							<?endif;?>
						<?endforeach;?>
					</table>
				<?else:?>
					<div class="alert-box success"><i>No Schedules Assigned.</i></div>
				<?endif;?>
			<?endif;?>
		</div>
	</section>
</div>

<span id="loader" url="<?=image_url('load.gif');?>"></span>
<script src="<?=script_url('custom/teacherauthgrades');?>"></script>

<script>
	$(document).ready(function(){
		$(document).find('input[type=text]').attr('disabled','disabled');
		$(document).find('select').attr('disabled','disabled');

		$( "input[type=checkbox]#grades" ).change(function() {
			if($(this).is(':checked'))
			{
				$(document).find('select.grades').removeAttr('disabled');
			}else{
				$(document).find('select.grades').attr('disabled','disabled');
			}
		});
		var icons = {
		  header: "ui-icon-circle-arrow-e",
		  activeHeader: "ui-icon-circle-arrow-s"
		}
		$('.accordions').accordion({
      		heightStyle: "content",
      		icons:icons
    	});
	});
</script>



<div id="commendations" class="reveal-modal">
  <p class="lead-title">Send Student A Commendation.</p>
  <form id="commend" action="<?=site_url(['output','commendation']);?>" method="POST" data-additional-params="">
  	<textarea name="student_commendation_commendation" style="height:250px;min-height:250px;max-height:250px;min-width:100%;max-width:100%;" required></textarea>
  	<button class="btn btn-primary" id="submit_commendation">Send To Student</button>
  </form>
  <a class="close-reveal-modal">&#215;</a>
</div>


<script src="<?=script_url('custom/commendstudent');?>"></script>